package com.sxt;
import java.awt.*;

public class GameObj {
    Image img;
    int x;
    int y;
    int width;
    int height;
    double speed;
    GameWin frame;
    public Image getImg() {
        return img;
    }
    public void setImg(Image img) {
        this.img = img;
    }
    public int getX() {
        return x;
    }
    public void setX(int x) {
        this.x = x;
    }
    public int getY() {
        return y;
    }
    public void setY(int y) {
        this.y = y;
    }
    public int getWidth() {
        return width;
    }
    public void setWidth(int width) {
        this.width = width;
    }
    public int getHeight() {
        return height;
    }
    public void setHeight(int height) {
        this.height = height;
    }
    public double getSpeed() {
        return speed;
    }
    public void setSpeed(double speed) {
        this.speed = speed;
    }
    public GameWin getFrame() {
        return frame;
    }
    public void setFrame(GameWin frame) {
        this.frame = frame;
    }

    //无参构造
    public GameObj() {
    }
    public GameObj(Image img, int x, int y , double speed) {
        // TODO Auto-generated constructor stub
        this.img = img;
        this.x = x;
        this.y = y;
        this.speed = speed;

    }

    //有参构造
    public GameObj(Image img, int x, int y, int width,
                   int height, double speed,GameWin frame) {
        this.img = img;
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.speed = speed;
        this.frame = frame;
    }
    public void paintself(Graphics gImaage) {
        gImaage.drawImage(img, x, y,null);

    }
    public Rectangle getRec() {//构件周围的矩形
        return new Rectangle(x,y,width,height);
    }
}
